<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>${title }</title>
<!--自定义index样式-->
<link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css"></link>
<link rel="stylesheet" href="${ctx }/static/styles/edit/tableStyle.css"></link>
<!--js库-->
<%@ include file="/static/commons/jquery-easyui.jsp"%>
<script type="text/javascript" src="${ctx}/static/scripts/set_select.js"></script>
<script type="text/javascript" src="${ctx}/static/scripts/WdatePicker/WdatePicker.js"></script>
<script type="text/javascript">
	var headers = {};
	headers['__RequestVerificationToken'] = "${RequestVerificationToken}";
</script>
<style type="text/css">
body{overflow: hidden; padding: 10px 20px;}

#qjy input[type='text']{height: 100%; }
.gasDiv{width:100px; min-height: 26px; border: 0; font-size: 12px;text-align: left;}
.gasDiv input{width:inherit; height:inherit; cursor: pointer;}
.gasDiv label{margin: 2px; display: inline-block; cursor: pointer; min-width: 43px;}
.gasDiv span{width:100%;display:block; text-align:center; line-height: 26px; height: 26px;}
</style>
</head>

<body>
	<c:set var="disabled" value=""></c:set>
	<c:set var="ifSelect" value=""></c:set>
  	<c:if test="${not empty view}">
  		<c:set var="disabled" value="none"></c:set>
  		<c:set var="ifSelect" value="false"></c:set>
  	</c:if>
	
	<form id="editForm" method="post">
	<input type="hidden" value="${obj.billing_id}" id="billingId" name="p_billingId" ></input>
		<table class="table-ltr">
			<caption>
				回款详情
			</caption>
			<tbody>
				<tr>
				    <td>单位名称：</td>
					<td>
					   <input type="text" value="${obj.cust_name }" readonly="readonly" ></input>
					</td>
					
					<td>总金额：</td>
					<td>
					  <input type="text" id="totalPrice" value="${obj.total_price }" readonly="readonly"  ></input>
					</td>
					
					<td>已回款金额：</td>
					<td>
						<input type="text" id="alreadyPaid" value="${alreadyPaid }"readonly="readonly" ></input>
					</td>			
				</tr>
				<tr style="display:${disabled }">
				    <td class="non-empty">回款方式：</td>
					<td>
					    <vvise:select id="paymentWay" name="p_paymentWay" sqlname="getCodeData" sqlparam="bill_type" />
					</td>
					<td class="non-empty">回款比例：</td>
					<td>
					   <vvise:select id="status" name="p_status" sqlname="getCodeData" sqlparam="pay_ratio" />
					</td>
					
					<td class="non-empty">回款金额：</td>
					<td>
					   <input type= number id="paymentAmount" name="p_paymentAmount"  min= 1 max= 100000000 ></input>
					</td>				
					
				</tr>
				<tr style="display:${disabled }">
					<td class="non-empty">回款日期：</td>
					<td>					 
                       <input type="text" id="paymentDate" name="p_paymentDate" onFocus="WdatePicker()" style="width: 100%;"></input>
					</td>
					
					<td>回款备注：</td>
					<td colspan="3">
					     <input type="text" id="paymentRemark" name="p_paymentRemark"  maxLength="100" ></input>
					</td>
				</tr>
				
			</tbody>
		</table>
		<c:if test="${details!= null && fn:length(details) > 0}">
		<div class="tab">			
			<div class="tab-body">
				<div class="tab-content s0">
					<table class="table-utd" id="qp">
						<thead>
							<tr>
								<th>序号</th>
								<th>回款金额</th>
								<th>回款方式</th>
								<th>回款时间</th>
								<th>回款备注</th>								
							</tr>
						</thead>
						<c:forEach items="${details }" var="d" varStatus="status">
						 <tbody>
							<tr>
								<td>${status.count }</td>
								<td><input type="text" disabled=${disabled } value="${d.payment_amount}"></input></td>
								<td>
									<vvise:select id="paymentWay" name="paymentWay" sqlname="getCodeData" defval="${d.payment_way }"
										sqlparam="pay_way" ifSelect="${ifSelect }"/>
										</td>
								<td><input type="text" disabled=${disabled } value="<fmt:formatDate value="${d.payment_date }" pattern="yyyy-MM-dd"/>" ></input></td>
								<td><input type="text" disabled=${disabled } value="${d.payment_remark }"></input></td>
							</tr>
						 </tbody>
						</c:forEach>
					</table>
				</div>
			</div>
		</div>
	  </c:if>

	</form>
</body>
<script type="text/javascript">
var wh = $(window).height();
var ht = wh - 20 - 161 - 40 - 5;
$('.tab-body').height(ht);
</script>
</html>